/**
 * This file is part of the CAKIS project.
 * 
 * Copyright (c) 2009-2010 - Florian Arndt, Christian Kerl
 * 
 * @license GNU Lesser General Public License v3 <http://www.opensource.org/licenses/lgpl-3.0.html>
 * @since   11.05.2010
 * @version SVN: $Id: ClientSessionRedirectEvent.java 120 2010-05-11 20:11:01Z christian-kerl@web.de $
 */
package org.cakis.server.service.session;

import java.io.Serializable;
import java.util.UUID;

import org.jboss.seam.faces.Redirect;

/**
 * ClientSessionRedirectEvent
 *
 * @author Christian Kerl
 */
public abstract class ClientSessionRedirectEvent implements Serializable {
    private static final long serialVersionUID = 1L;

    private final String id;
    private final ClientSessionInfo session;
    private final String description;

    public String getId() {
        return id;
    }

    public ClientSessionInfo getSession() {
        return session;
    }

    public String getDescription() {
        return description;
    }

    public ClientSessionRedirectEvent(ClientSessionInfo session, String description) {
        this.id = UUID.randomUUID().toString();
        this.session = session;
        this.description = description;
    }

    public abstract void apply(Redirect redirect);

    @Override
    public String toString() {
        return "ClientSessionRedirectEvent[id=" + getId() + "]";
    }
}
